﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace ProjectClass.DAL
{
    public static class SimpleSessionPersister
    {
        static string CurrentUser = "username";
        public static string UserName
        {
            get
            {
                if (HttpContext.Current == null) return string.Empty;
                var SessionVar =
                    HttpContext.Current.Session[CurrentUser];
                if (SessionVar != null)
                    return SessionVar as string;
                return null;
            }
            set { HttpContext.Current.Session[CurrentUser] = value; }
        }
    }
}